package org.mq.mymq.nameserver.enums;

/**
 * @ClassName ReplicationModeEnum
 * @Description
 * @Author jiarong_ye
 * @Date 2025/6/19 23:54
 * @Version 1.0
 */
public enum ReplicationModeEnum {
    MASTER_SLAVE("master_slave", "主从复制模式"),
    TRACE("trace", "链路复制模式"),
    ;
    String code;
    String desc;

    ReplicationModeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ReplicationModeEnum of(String code) {
        for (ReplicationModeEnum mode : ReplicationModeEnum.values()) {
            if (mode.getCode().equals(code))
                return mode;
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
